@{
    Ajax.Dna().Widget()
        .UserPreferences(widget =>
        {
            Ajax.Dna().RichTextBox(widget.GenerateFieldID("Text"))
                  .ToolPanes(panes =>
                          {
                              panes.Add().CustomTools(tool =>
                              {
                                  tool.Add().Buttons(buttons =>
                                  {
                                      buttons.AddIconButton("d-rte-icon d-rte-img", "$dna.fileDlg(\"" + Url.Action("Dialog", "WebFiles", new { Area = "", website = WebSiteContext.Current.Web.Name }) + "\",null,function(_src){ $(\"#" + widget.GenerateFieldID("Text") + "\").richtextbox(\"runCmd\",\"insertHTML\",\"<img src='\"+_src+\"' alt=''/>\");});");
                                  });
                              });
                          })
                .Resizable()
                .Value(widget.UserPreferences["Text"] != null ? Server.HtmlDecode(widget.UserPreferences["Text"].ToString()) : "")
                .Render();
        })
        .Content(@<text>
    @{ var _txt = (item.UserPreferences["Text"] != null) ? MvcHtmlString.Create(Server.HtmlDecode(item.UserPreferences["Text"].ToString())) : MvcHtmlString.Empty; }
    @_txt
    </text>)
.Preview(@<text>
    <h3>
        Simple html</h3>
    <p>
        <u>DotNetAge</u> is a web content mangement system (CMS) and <b>RAD platform </b>
        that focus on aesthetics ,ease-of-use and Web Standards.
    </p>
    <p>
        She offers an intuitive interface allows non-technical users to easily create new
        sites or extend the functionality and features of their existing web site when used
        as a web CMS.</p>
    </text>)
.Render();
}
